
var Crypto = {
  //加密
  encryption(data) {
    data = JSON.stringify(data)
    var str = '';
    var alterText = [];
    var varCost = [];
    var TextLength = data.length;
    for (var i = 0; i < TextLength; i++) {
      var random = parseInt(Math.random() * 266);
      alterText[i] = data.charCodeAt(i) + random;
      varCost[i] = random;
    }
    for (var i = 0; i < TextLength; i++) {
      str += String.fromCharCode(alterText[i], varCost[i]);
    }
    return str;
  },
};